import pymysql
from config import MYSQL_PWD, DB_NAME

def get_db_connection():
    try:
        return pymysql.connect(host="localhost",  port=3307, user="root", password=MYSQL_PWD, database=DB_NAME, charset='utf8')
    except pymysql.Error as e:
        print(f"Database connection error: {e}")
        return None